package com.pacy.pacybaseproject.viewmodels;

import android.app.Application;

import androidx.annotation.NonNull;

import com.pacy.pacybaseproject.activitys.AuthMethodActivity;
import com.pacy.pacybaseproject.activitys.AuthPayActivity;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;

/**
 * @author PACY
 * @date 2024/2/23
 * description:
 */
public class AuthMethodViewModel extends BaseViewModel {
    public SingleLiveEvent<Boolean> checkAlipay=new SingleLiveEvent<>(true);
    public AuthMethodViewModel(@NonNull Application application) {
        super(application);
    }

    @Override
    protected void init() {
        super.init();
        checkAlipay.setValue(true);
    }

    /**
     * 选中支付宝
     */
    public BindingCommand checkAlipayClick=new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            checkAlipay.setValue(true);
        }
    });

    /**
     * 选中微信
     */
    public BindingCommand checkWechatClick=new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            checkAlipay.setValue(false);
        }
    });

    /**
     * 去签约
     */
    public BindingCommand toNextPage=new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            startActivity(AuthPayActivity.class);
        }
    });
}
